package uk.co.q3c.deplan.server.service;

import java.util.List;

import uk.co.q3c.deplan.client.dao.ResourceService;
import uk.co.q3c.deplan.client.dao.ResourceServiceAsync;
import uk.co.q3c.deplan.client.domain.resource.IndividualResource;
import uk.co.q3c.deplan.client.domain.resource.Resource;
import uk.co.q3c.deplan.client.domain.resource.ResourceGroup;
import uk.co.q3c.deplan.client.domain.resource.ResourcePool;
import uk.co.q3c.deplan.client.domain.task.BaseTask;
import uk.co.q3c.deplan.client.domain.task.Task;
import uk.co.q3c.deplan.server.dao.DomainDao;

import com.googlecode.objectify.Key;
import com.googlecode.objectify.Query;

/**
 * @see ResourceService
 * @see ResourceServiceAsync
 * @author dsowerby
 * 
 */
@SuppressWarnings("serial")
public class ResourceService_BigT extends ServiceProviderBase implements ResourceService {

	public ResourceService_BigT(DomainDao dao) {
		super(dao);
	}

	@Override
	public List<ResourcePool> findResourcePools() {
		return dao.findUndiscardedList(ResourcePool.class);
	}

	@Override
	public List<ResourceGroup> groupsFromsKeys(List<Key<ResourceGroup>> groupsKeys) {
		return dao.getList(groupsKeys);
	}

	@Override
	public List<IndividualResource> individualsFromKeys(List<Key<IndividualResource>> individualsKeys) {
		return dao.getList(individualsKeys);
	}

	@Override
	public <T extends Resource> Key<T> keyFor(T resource) {
		return dao.keyFor(resource);
	}

	@Override
	public List<Task> tasksUsingResource(IndividualResource resource) {
		Query<BaseTask> q = dao.newQuery(BaseTask.class);
		throw new RuntimeException("not yet implemented");
	}

}
